package springbook.demo.Controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
import springbook.demo.entity.User;


@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private User user;
    @RequestMapping("/findone")
    public ModelAndView findone(){
        ModelAndView md =new ModelAndView();
//        User user =new User(1,"cyh","123456");
        user.setAge(19);
        user.setName("cmd");
        user.setPassword("456123");
        md.addObject("users",user);
        md.setViewName("user");
        return md;
    }
}
